package com.Service.impl;

import com.Bean.Department;
import com.Common.Result;
import com.Dao.EmployeeDao;
import com.Service.EmployeeService;
import org.junit.Test;

import java.util.Iterator;
import java.util.List;

/**
 * @description:
 * @author: hkw14
 * @time: 2021/5/6 10:12
 */
public class EmployeeServiceImpl implements EmployeeService {
    EmployeeDao employeeDao = new EmployeeDao();
    @Override
    public Result getPartmentList() {
        List<Department> list = employeeDao.getList();
        return new Result(list);
    }

    @Test
    public void test(){
        EmployeeServiceImpl employeeService = new EmployeeServiceImpl();
        Result partmentList = employeeService.getPartmentList();
        List<Department> data = (List<Department>) partmentList.getData();
        Iterator<Department> iterator = data.iterator();
        while (iterator.hasNext()){
            Department next = iterator.next();
            System.out.println(next);
        }
    }
}
